<?php
include_once '/class_master/db.class.php';


class machine extends salle{
	private $id_machine , $nom_machine, $ip_machine, $status_machine, $id_salle;
	
	public function  __construct($id)
	{
		if (isset($_GET['id_salle'])){
			$id_salle = $_GET['id_salle'];
		}else{
			$id_salle = "erreur";
		}
		
		$nom_machine = "";
		$compteur = '0';
		$db = new db();
		$check = new check();
		$requet = $db->select("ip_machine, nom_machine","machine", "id_machine = ".$id);
		while ($row = $requet->fetch())
		{
			$ip_machine = $row[0];
			$nom_machine = $row[1];
		}
		
		echo "<div class='pc'>";
			$res = $check->get_check_item("machine",$id);
				if ($res == 'OK')
				{
					echo "<span class='vert' id='vert[0]'>.</span>";
				}
				else
				{	
					echo "<span class='rouge' id='vert[1]'>.</span>";
				}
				echo  "
			<a href='information_machine.php?id_salle=$id_salle&ip_machine=$ip_machine&nom_machine=$nom_machine&id_machine=$id'><p class=nom_pc>$nom_machine</p></a>
	       
        </div>";
	}

	public function  get_id_machine($id_machine)
	{
		return $this->id_machine;
	}

	public function set_id_machine($id_machine)
	{
		$this->id_machine = $id_machine;
	}

	public function  get_ip_machine($ip_machine)
	{
		return $this->ip_machine;
	}
	
	public function set_ip_machine($ip_machine)
	{
		$this->ip_machine = $ip_machine;
	}
	
	public function get_nom_machine($nom_machine)
	{
		return $this->nom_machine;
	}
	
	public function set_nom_machine($nom_machine)
	{
		$this->nom_machine = $nom_machine;
	}
	
	public function  get_status_machine($status_machine)
	{
		return $this->status_machine;
	}
	public function set_status_machine($status_machine)
	{
		$this->status_machine = $status_machine;
	}
	
	
}
?>